/**
 * 
 */
package org.xserver.integration;

import junit.framework.TestCase;

import org.openqa.selenium.htmlunit.HtmlUnitDriver;

/**
 * @author jkonopka
 * 
 */
public abstract class SeleniumTestCase extends TestCase {

	protected final HtmlUnitDriver driver = new HtmlUnitDriver(true);

	/**
	 * @return the driver
	 */
	protected final HtmlUnitDriver getDriver() {
		return driver;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see junit.framework.TestCase#setUp()
	 */
	@Override
	protected void setUp() throws Exception {
		super.setUp();
		driver.get("http://localhost:9090/xserver-war/" + getSide());
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see junit.framework.TestCase#tearDown()
	 */
	@Override
	protected void tearDown() throws Exception {
		super.tearDown();
		driver.close();
	}

	/**
	 * @return z.B. 'index.html'
	 */
	protected abstract String getSide();

}
